
public class p1014_timeout {

	public static//
	// -----
	// -----
	class Main {
		public static void main(String[] args) throws Exception {
			java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(System.in));
			int id = 0;
			while (true) {
				String line = reader.readLine();
				if (line.startsWith("0 0 0 0 0 0"))
					break;
				String[] parts = line.split(" ");
				int[] nums = new int[6];
				for (int i = 0; i < 6; i++)
					nums[i] = Integer.parseInt(parts[i]);
				System.out.println("Collection #" + (++id) + ":\nCan" + (process(nums) ? "" : "'t") + " be divided.\n");
			}
		}

		static boolean process(int[] nums) {
			int sums[] = new int[6];
			sums[0] = nums[0];
			for (int i = 1; i < 6; i++)
				sums[i] = sums[i - 1] + nums[i] * (i + 1);
			if (sums[5] % 2 != 0)
				return false;
			return process2(nums, sums, 5, sums[5] / 2);
		}

		static boolean process2(int[] nums, int[] sums, int cur, int left) {
			int sum = sums[cur];
			if (left < 0 || left > sum)
				return false;
			if (cur == 0 || left == 0 || left == sum)
				return true;
			int num = nums[cur];
			int val = cur + 1;
			for (int i = 0; i <= num; i++) {
				if (process2(nums, sums, cur - 1, left - i * val))
					return true;
			}
			return false;
		}
	}

	// -----
	// -----

	public static void main(String[] args) throws Exception {
		Judge.run();
	}

}
